package com.northone.statistics.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.northone.statistics.R;

public class LeftListAdapter extends BaseAdapter {
	
	private Context context;
	private String[] data;
	public int currentItemIndex;

	public LeftListAdapter(Context context, String[] data) {
		this.context = context;
		this.data = data;
	}

	@Override
	public int getCount() {
		return data.length;
	}

	@Override
	public String getItem(int position) {
		return data[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView view = (TextView) View.inflate(context, R.layout.left_menu_item, null);
		view.setText(getItem(position));
		view.setEnabled(currentItemIndex == position);
		return view;
	}
}
